package cn.taoticket.service;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import cn.taoticket.mapper.TaoticketKeywordSortMapper;
import cn.taoticket.pojo.TaoticketKeywordSort;

import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.Date;
import java.util.List;
import java.util.Map;
/**
 * Created by taoticket
 */
@RestController
public class RestTaoticketKeywordSortService {

    @Resource
     private TaoticketKeywordSortMapper taoticketKeywordSortMapper;

     @RequestMapping(value = "/getTaoticketKeywordSortById",method = RequestMethod.POST)
     public TaoticketKeywordSort getTaoticketKeywordSortById(@RequestParam("id") Long id)throws Exception{
        return taoticketKeywordSortMapper.getTaoticketKeywordSortById(id);
     }

     @RequestMapping(value = "/getTaoticketKeywordSortListByMap",method = RequestMethod.POST)
     public List<TaoticketKeywordSort>	getTaoticketKeywordSortListByMap(@RequestParam Map<String,Object> param)throws Exception{
        return taoticketKeywordSortMapper.getTaoticketKeywordSortListByMap(param);
     }

     @RequestMapping(value = "/getTaoticketKeywordSortCountByMap",method = RequestMethod.POST)
     public Integer getTaoticketKeywordSortCountByMap(@RequestParam Map<String,Object> param)throws Exception{
        return taoticketKeywordSortMapper.getTaoticketKeywordSortCountByMap(param);
     }

     @RequestMapping(value = "/qdtxAddTaoticketKeywordSort",method = RequestMethod.POST)
     public Integer qdtxAddTaoticketKeywordSort(@RequestBody TaoticketKeywordSort taoticketKeywordSort)throws Exception{
        taoticketKeywordSort.setCreatedTime(new Date());
        return taoticketKeywordSortMapper.insertTaoticketKeywordSort(taoticketKeywordSort);
     }

     @RequestMapping(value = "/qdtxModifyTaoticketKeywordSort",method = RequestMethod.POST)
     public Integer qdtxModifyTaoticketKeywordSort(@RequestBody TaoticketKeywordSort taoticketKeywordSort)throws Exception{
        taoticketKeywordSort.setUpdatedTime(new Date());
        return taoticketKeywordSortMapper.updateTaoticketKeywordSort(taoticketKeywordSort);
     }
}
